<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 引入dayjs -->
    <script src="https://cdn.bootcdn.net/ajax/libs/dayjs/1.10.6/dayjs.min.js"></script>
    <!-- 引入Vue.js -->
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.14/vue.js"></script>
    <link rel="stylesheet" href="css/index.css">

    <title>Document</title>
</head>

<body>
    <div id="clock">
        <p :data-text="time">{{time}}</p>
    </div>

    <script>
        Vue.config.productionTip = false
        const app = new Vue({
            el: "#clock",
            data() {
                return {
                    time: dayjs().format('HH:mm:ss')
                }
            },
            mounted() {
                setInterval(() => {
                    this.time = dayjs().format('HH:mm:ss')
                }, 1000);
            },
        })

    </script>
</body>

</html>